package controller;

import java.awt.Point;
import java.awt.event.MouseEvent;

import view.GeoState;
import view.GeometryDescriptor;

public class IdleSt extends State
{

	public IdleSt(DrawingController controller) 
	{
		super(controller);
	}

	@Override
	public void update(Input input, InputMod mod, Point p)
	{
		if (input != Input.MD && mod != InputMod.LD)
			return;
		
		GeometryDescriptor gDesc = this.controller.getView().pointGeometry(p);
				
		switch (gDesc.getGeoState() )
		{
		case INSIDE:
			this.controller.setState(new SelectSt(this.controller));
			this.controller.selectObject(gDesc);
			break;
		case OUTSIDE:
			// State remains idle
//			createObject(p);
			break;
		default:
			throw new RuntimeException("Illegal State!");
		}
		
	}

//	private void createObject(Point p)
//	{
//		/*
//		if !in creation mode
//			RETURN
//		
//		create a new object
//		add to the model
//		select new object and the controlpoint to be moved
//		
//		 */
//		
//		if (controller.menuState == Pallette.SELECT)
//			return;
//		
//		controller.createNewObject(p);
//		
//		
//	}

	@Override
	public void update(Input input, InputMod mod, char letter)
	{
		
	}

}
